#ifndef HERO_H
#define HERO_H

#include <SDL.h>
#include <SDL_image.h>
#include "../include/temel.h"
#include "../include/tugla.h"

enum Direction
{
    RIGHT=0,
    LEFT,
    JUMP,
    NONE
};

class Hero : public Temel
{
    public:
        Hero();
        virtual ~Hero();
        void Render(SDL_Surface* screen);
        void Logic();

        //Collision algoritması için
        bool CheckCollision(Temel* entityA, Temel* entityB);
        bool GetAlphaXY(Temel* entity, int x, int y);
        void sendTugla(Tugla* _tugla);
        ////////////////////////////////
        void jump();

        ///////////////////////////////////////////////////////////////////
        void setSpriteFrame();
        void setDeltaSure();
        void setDelta(double delta) { deltaSure = delta; }
        void setDirection(Direction dir) { direction = dir; }
        void setWalkState(bool state) { walkState = state; }
        void setJumpState(bool state) { jumpState = state; }

        double getDelta(){ return deltaSure; }
        bool getWalkState() { return walkState; }
        bool getJumpState() { return jumpState; }
        /////////////////////////////////////////////////////////////////

    protected:
    private:

        int frame;
        int frameCount;
        int frameCounter;
        int deltaJump;
        double thisTime;
        double lastTime;
        double sure;
        double deltaSure;

        bool walkState;
        bool jumpState;

        std::vector<Temel*>::iterator itRender;
        Tugla* tugla;

        Direction direction;
};

#endif // HERO_H
